package app.r_teenus.backend.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "INVOICE")
public class Invoice implements Serializable {

	private static final long serialVersionUID = 3234725222252727495L;
	private Integer id = null;
	private Date invoiceDate = null;
	private Date dueDate = null;
	private Double price = null;
	private String receiverName = null;
	private String refNumber = null;
	private String receiverAccount = null;
	private Date paymentDate = null;
	private String description = null;
	private InvoiceStatusType invoiceStatusType = null;
	private Customer customer = null;
	
	/**
	 * Gets id (primary key).
	 */
	@Id
	@Column(name = "invoice")
	@SequenceGenerator(name = "invoice_id", sequenceName = "invoice_id", allocationSize = 1)
	@GeneratedValue(generator = "invoice_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "invoice_date")
	public Date getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	@Column(name = "due_date")
	public Date getDueDate() {
		return dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	@Column(name = "price_total")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "receiver_name")
	public String getReceiverName() {
		return receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	@Column(name = "reference_number")
	public String getRefNumber() {
		return refNumber;
	}

	public void setRefNumber(String refNumber) {
		this.refNumber = refNumber;
	}

	@Column(name = "receiver_accounts")
	public String getReceiverAccount() {
		return receiverAccount;
	}

	public void setReceiverAccount(String receiverAccount) {
		this.receiverAccount = receiverAccount;
	}

	@Column(name = "payment_date")
	public Date getPaymentDate() {
		return paymentDate;
	}

	public void setPaymentDate(Date paymentDate) {
		this.paymentDate = paymentDate;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToOne
	@JoinColumn(name = "INVOICE_STATUS_TYPE_FK", nullable = false)
	public InvoiceStatusType getInvoiceStatusType() {
		return invoiceStatusType;
	}

	public void setInvoiceStatusType(InvoiceStatusType invoiceStatusType) {
		this.invoiceStatusType = invoiceStatusType;
	}
	@OneToOne
	@JoinColumn(name = "CUSTOMER_FK", nullable = false)
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

}
